package cn.joker.entity.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 权限表（菜单和按钮权限）
 * </p>
 *
 * @author joker
 * @since 2025-04-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_permissions")
@ApiModel(value = "Permissions对象", description = "权限表（菜单和按钮权限）")
public class Permissions implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "权限ID，主键自增")
    @TableId(value = "permission_id", type = IdType.AUTO)
    private Long permissionId;

    @ApiModelProperty(value = "权限名称")
    @TableField("permission_name")
    private String permissionName;

    @ApiModelProperty(value = "权限标识，用于程序识别")
    @TableField("permission_code")
    private String permissionCode;

    @ApiModelProperty(value = "权限类型：1-菜单, 2-按钮, 3-API接口")
    @TableField("permission_type")
    private Integer permissionType;

    @ApiModelProperty(value = "资源路径（菜单URL或API路径）")
    @TableField("path")
    private String path;

    @ApiModelProperty(value = "HTTP方法（GET/POST/PUT/DELETE等）")
    @TableField("method")
    private String method;

    @ApiModelProperty(value = "父权限ID，0表示一级权限")
    @TableField("parent_id")
    private String parentId;

    @ApiModelProperty(value = "显示顺序")
    @TableField("order_num")
    private Integer orderNum;

    @ApiModelProperty(value = "菜单图标")
    @TableField("icon")
    private String icon;

    @ApiModelProperty(value = "是否可见：0-隐藏, 1-显示")
    @TableField("visible")
    private Integer visible;

    @ApiModelProperty(value = "前端组件路径（Vue/React等）")
    @TableField("component")
    private String component;

    @ApiModelProperty(value = "是否外链：0-否, 1-是")
    @TableField("is_frame")
    private Integer isFrame;

    @ApiModelProperty(value = "权限描述")
    @TableField("description")
    private String description;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "所属系统标识")
    @TableField("system_code")
    private String systemCode;


}
